package xyz.lne.researchgroupmanage.controller;

import lombok.RequiredArgsConstructor;
import org.neo4j.ogm.model.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.lne.researchgroupmanage.annotation.AnonymousGetMapping;
import xyz.lne.researchgroupmanage.common.CommonResponse;
import xyz.lne.researchgroupmanage.service.Neo4jService;

/**
 * Designed By Lne.
 * 2021/3/3 8:58
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/neo4j")
public class Neo4jController {
    private final Neo4jService neo4jService;

    @AnonymousGetMapping("/mysql2neo4j")
    public CommonResponse mySqlToNeo4j(){
        neo4jService.mySqlToNeo4j();
        return CommonResponse.create(CommonResponse.STATUS_SUCCESS);
    }

//    根据课题的id 获取相关课题的推送 数量为size
    @AnonymousGetMapping("/get-related-researches")
    public Result getRelatedResearches(Integer researchId, Integer size){
        return neo4jService.getRelatedResearches(researchId, size);
    }

//    获取相关的课题组推荐
    @AnonymousGetMapping("/get-related-research-groups")
    public Result getRelatedResearchGroups(Integer researchGroupId, Integer size){
        return null;
    }
}
